package com.nwu.user.mapper;

import com.nwu.user.domain.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 82527
* @description 针对表【user(用户表)】的数据库操作Mapper
* @createDate 2024-05-23 16:07:52
* @Entity com.nwu.user.domain.User
*/
public interface UserMapper extends BaseMapper<User> {

    @Select("        select distinct m.menu_name\n" +
            "        from\n" +
            "            `psy-user`.role_user\n" +
            "                left join `psy-user`.role r on r.id = role_user.role_id\n" +
            "                left join `psy-user`.role_menu rm on r.id = rm.role_id\n" +
            "                left join `psy-user`.menu m on rm.menu_id = m.id\n" +
            "        where user_id = #{id}")
    List<String> selectPermsByUserId(Long id);
}




